home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F29150_foldl.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-11-03  |  1.1 KB  |  32 lines

  1. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  2.     <xsl:template name="foldl">
  3.       <xsl:param name="pFunc" select="/.."/>
  4.       <xsl:param name="pA0"/>
  5.       <xsl:param name="pList" select="/.."/>
  6.  
  7.       <xsl:choose>
  8.          <xsl:when test="not($pList)">
  9.             <xsl:copy-of select="$pA0"/>
  10.          </xsl:when>
  11.          <xsl:otherwise>
  12.  
  13.             <xsl:variable name="vFunResult">
  14.               <xsl:apply-templates select="$pFunc[1]">
  15.                 <xsl:with-param name="arg0" select="$pFunc[position() > 1]"/>
  16.                 <xsl:with-param name="arg1" select="$pA0"/>
  17.                 <xsl:with-param name="arg2" select="$pList[1]"/>
  18.               </xsl:apply-templates>
  19.             </xsl:variable>
  20.  
  21.             <xsl:call-template name="foldl">
  22.                 <xsl:with-param name="pFunc" select="$pFunc"/>
  23.                 <xsl:with-param name="pList" select="$pList[position() > 1]"/>
  24.                 <xsl:with-param name="pA0" select="$vFunResult"/>
  25.  
  26.             </xsl:call-template>
  27.          </xsl:otherwise>
  28.       </xsl:choose>
  29.  
  30.     </xsl:template>
  31.  
  32. </xsl:stylesheet>